<template>
  <div class="outline-parent">
    <div
      class="flex-box border-hover-style"
      :style="!props.info.subTitle && !props.info.value && !props.info.remarks && { paddingBottom: 0 }"
    >
      <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
      </t-image-viewer>
      <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
      </van-image-preview>
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img class="outline-parent-bg" :src="publicUrls + 'free/style13/Level3outlineStyle1Bg.webp'" alt="" />
      <div class="outline">
        <div class="outline-content" v-if="props.info.subTitle || props.info.remarks || props.info.value">
          <div class="outline-title-box">
            <div class="outline-title" v-html="textType(props.info.text)" v-if="props.info.text?.length >= 8"></div>
            <div class="outline-title" v-else>
              <p>{{ props.info.text }}</p>
            </div>
          </div>
          <div class="outline-subTitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</div>
          <div class="outline-cover" v-if="props.info.value">
            <img
              @click="ImgVisible = true"
              :src="urls + props.info.value + '?imageView2/3/w/898/h/460/format/webp'"
              alt=""
            />
          </div>
          <TextMax
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :infoData="props.info"
            :row="
              props.info.value && props.info.subTitle
                ? 2
                : !props.info.value && props.info.subTitle
                ? 7
                : props.info.value && !props.info.subTitle
                ? 4
                : 7
            "
          ></TextMax>
        </div>
        <div class="outline-content" v-else>
          <div class="outline-title2">
            <p>{{ props.info.text }}</p>
          </div>
        </div>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style8/firstLevelOutline2Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free13Style1',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import textMode from '../../../textMode/textMode.vue';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style13.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 140px;
  margin-left: 40px;
  .shadow {
    width: 462px;
    height: 128px;
    position: absolute;
    bottom: 0;
    left: 40px;
  }
}
.Showroom-parent {
  position: absolute;
  top: 50px;
  right: -20px;
  z-index: 23;
}
.flex-box {
  width: 370px;
  height: 684px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 0 0 56px 0;
  z-index: 20;
}

.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  width: 270px;
  height: 100%;
  z-index: 22;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.outline-content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.outline-title-box {
  height: 214px;
  margin-bottom: 40px;
  margin-top: 60px;
}
.outline-title2 {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  ::v-deep p {
    font-size: 22px;
    color: #333333;
    line-height: 26px;
    text-align: center;
    font-family: 'SourceHanSerifCN-Bold';
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 4px;
    &:nth-child(2) {
      margin-left: 8px;
    }
  }
  &::after {
    content: '';
    width: 25px;
    height: 392px;
    position: absolute;
    top: 50%;
    left: -35px;
    transform: translateY(-50%);
    background: url(https://static.jiyi.show/free/style13/Level3outlineStyle1Titlebg2.webp) no-repeat center/100% 100%;
  }
  &::before {
    content: '';
    width: 25px;
    height: 392px;
    position: absolute;
    top: 50%;
    right: -35px;
    transform: translateY(-50%) rotate(180deg);
    background: url(https://static.jiyi.show/free/style13/Level3outlineStyle1Titlebg2.webp) no-repeat center/100% 100%;
  }
}
.outline-title {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  ::v-deep p {
    font-size: 22px;
    color: #333333;
    line-height: 26px;
    text-align: center;
    font-family: 'SourceHanSerifCN-Bold';
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 4px;
    &:nth-child(2) {
      margin-left: 8px;
    }
  }
  &::after {
    content: '';
    width: 25px;
    height: 189px;
    position: absolute;
    top: 50%;
    left: -35px;
    transform: translateY(-50%);
    background: url(https://static.jiyi.show/free/style13/Level3outlineStyle1Titlebg.webp) no-repeat center/100% 100%;
  }
  &::before {
    content: '';
    width: 25px;
    height: 189px;
    position: absolute;
    top: 50%;
    right: -35px;
    transform: translateY(-50%) rotate(180deg);
    background: url(https://static.jiyi.show/free/style13/Level3outlineStyle1Titlebg.webp) no-repeat center/100% 100%;
  }
}
.outline-subTitle {
  width: 100%;
  height: 48px;
  font-family: SourceHanSerifCN;
  font-size: 18px;
  color: #000000;
  line-height: 28px;
  text-align: center;
  margin-bottom: 16px;
  opacity: 0.8;
}
.outline-cover {
  width: 100%;
  height: 160px;
  background: #c4c4c4;
  margin-bottom: 24px;
  overflow: hidden;
  &:hover img {
    transform: scale(1.5);
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}
::v-deep .textMore-box {
  flex-shrink: 0;
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(0, 0, 0, 0.6) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #ff0505 !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>